import './App.css';
import React from 'react';
import Routers from "./routes";
import { ConfigProvider, theme } from 'antd';
import zhCN from 'antd/es/locale/zh_CN';
import useStores from './hooks/useStores';

import 'dayjs/locale/zh-cn';

const App: React.FC = () => {
  const { themes, color_primary } = useStores();
  return (
    <ConfigProvider
      locale={zhCN}
      theme={{
        algorithm: themes.type == 'dark' ? theme.darkAlgorithm : theme.defaultAlgorithm,
        cssVar: true,
        token: { colorPrimary: color_primary }
      }}>
      <Routers></Routers>
    </ConfigProvider>
  )
}

export default App;